<!--
 * @Description: 维修业务查询及查询进厂情况明细建，议维修项目页签
 * @Autor: 何兴家
 * @Date: 2020-07-20 18:59:35
 * @LastEditors: 何兴家
 * @LastEditTime: 2020-08-27 11:30:52
-->
<template>
  <div>
    <FilterTable ref="table" height="auto" :isSelectColumn="false" :columns="columns" :dataSource="tablelist" :onColumnsChange="columns => (this.columns = columns)"> </FilterTable>
  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
import { getJYXM } from '@/api/repair/repairReception/customer';

export default {
  name: 'xmzRepairProLab',
  mixins: [dictionary],
  props: ['roNo'],
  data() {
    return {
      columns: this.createTableColumns(),
      tablelist: []
    };
  },
  mounted() {
    this.createBaseTable();
    this.queryList();
  },
  methods: {
    createBaseTable() {
      this.BaseTable = this.$refs.table.$refs.pageTable;
    },
    // 查询建议维修项目
    async queryList() {
      console.log('进入方法');
      const res = await getJYXM(this.roNo);
      if (res.resultCode === 200) {
        this.tablelist = res.data || [];
      }
    },
    createTableColumns() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 70,
          sorter: true,
          render: props => {
            return <span>{props.row.$index + 1}</span>;
          }
        },
        {
          title: '建议维修项目代码',
          dataIndex: 'LABOUR_CODE',
          width: 200,
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '建议维修项目名称',
          dataIndex: 'LABOUR_NAME',
          sorter: true,
          filter: true,
          filterType: 'input',
          showOverflowTooltip: true
        },
        {
          title: '工时费',
          dataIndex: 'LABOUR_AMOUNT',
          width: 200,
          sorter: true,
          filter: true,
          filterType: 'input',
          editType: 'number'
        }
      ];
    }
  }
};
</script>

<style lang="less"></style>
